﻿@model List<Clirelmgt.Models.ObjectModel>

@{
    ViewBag.Title = "Object List";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}

<div class="dashboard-wrapper">
    <div class="left-sidebar">
        <div class="row-fluid">
            <div class="span12">
                <div class="widget">
                    <div class="widget-header">
                        <div class="title">
                            Object List
                        </div>
                    </div>
                    <form method="post">
                    <input type="submit" class="btn btn-success" style="margin: 10px;" value="+ Add" id="Btn_Add" name="Btn_Add" />
                    <input type="submit" class="btn btn-warning2" style="margin: 10px;" value="X Delete" id="Btn_Delete" name="Btn_Delete" onclick="return confirm('Are you sure want to proceed with deleting these objects?');" /><br />
                    <table class="table table-condensed table-striped table-bordered table-hover no-margin">
                        <thead>
                            <tr>
                                <th>
                                    <input type="checkbox" class="no-margin" />
                                </th>
                                <th>Type
                                </th>
                                <th>Name
                                </th>
                                <th>Linked Table
                                </th>
                                <th>Module
                                </th>
                                <th>Active
                                </th>
                                <th></th>
                            </tr>
                        </thead>
                        <tbody>
                            @if (Model != null)
                            {
                                foreach (var field in Model)
                                {
                                <tr>
                                    <td style="width: 30px">
                                        <input type="checkbox" class="no-margin" id="SelectRow_@field.Name" name="SelectRow_@field.Name" />
                                    </td>
                                    <td style="width: 70px">@field.ObjectType</td>
                                    <td>@field.Name</td>
                                    <td>@field.LinkTable</td>
                                    <td>@field.ModuleName</td>
                                    <td>@field.Active</td>
                                    <td style="width: 100px; padding-left:10px;">
                                        <div class="btn-group">
                                        <button data-toggle="dropdown" class="btn btn-mini dropdown-toggle">
                                            Edit 
                                            <span class="caret"></span>
                                        </button>
                                        <ul class="dropdown-menu">
                                            <li>
                                                <a href="/Object/Edit/@field.Name?type=@field.ObjectType">Description
                                                </a>
                                            </li>
                                            <li>
                                                <a href="/Object/@field.ObjectType/@field.Name">Fields
                                                </a>
                                            </li>
                                        </ul>
                                            </div>
                                    </td>
                                </tr>
                                }
                            }
                        </tbody>
                    </table>
                        </form>
                </div>
            </div>
        </div>

    </div>
    <div class="right-sidebar">

        <div class="wrapper">
            <a href="/Object/List/TABLE" class="btn btn-block btn-info" type="button">TABLES
            </a>
        </div>
        <div class="wrapper">
            <a href="/Object/List/CARD" class="btn btn-block btn-success" type="button">CARD PAGES
            </a>
        </div>
        <div class="wrapper">
            <a href="/Object/List/LIST" class="btn btn-block btn-warning" type="button">LIST PAGES
            </a>
        </div>
        <div class="wrapper">
            <a href="/Object/List/PROCESS" class="btn btn-block btn-warning2" type="button">PROCESS PAGES
            </a>
        </div>
    </div>
</div>
